package cn.itcast.dao;

import cn.itcast.bean.Student;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class IoMethod {
    public void get(Student student) throws IOException {
        BufferedWriter bw = new BufferedWriter(new FileWriter("d:\\student.txt",true));
        try {
            bw.write(student.getUsername() + "," + student.getAge() + "," + student.getScore());
            bw.newLine();
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
